﻿using System.Data.Entity.ModelConfiguration;
using BeautyTech.Core.Domain.Blogs;

namespace BeautyTech.Data.Configuration.Blog
{
    public class BlogPostConfiguration : EntityTypeConfiguration<BlogPost>
    {
        public BlogPostConfiguration()
        {
            this.Property(p => p.Title)
                .HasMaxLength(135).IsRequired();

            this.Property(p => p.Body)
                .IsRequired();

            this.Property(p => p.StartDate)
                .HasColumnType("date");

            this.Property(p => p.EndDate)
                .HasColumnType("date");
        }
    }
}
